import React from 'react';
import renderer from 'react-test-renderer';
import { fromJS } from 'immutable';
import { Version } from 'pages/version/index';

describe('pages/version/index', () => {
  beforeEach(() => {
    Version.contextTypes = {
      router: () => null
    };
  });

  test('Version should render correctly', () => {
    const props = fromJS({
    });
    const loadingProps = fromJS({
      display: true,
      text: ''
    });
    const emptyFunction = () => {
    };

    const component = renderer.create(
      <Version
        home={props}
        loading={loadingProps}
        getNewsByTitle={emptyFunction}
      />
    );
    const tree = component.toJSON();
    expect(tree).toMatchSnapshot();
  });
});
